<?php
require 'user.php';
require 'function.php';
if(is_dir($path=_decode($_GET['path'])==false)) {
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
Error：404
HTML;
exit;
}
header('Content-Type: text/html; charset=UTF-8');
echo <<<HTML
<html>
<head>
<title>文件管理－删除文件</title>
<style type="text/css">
.true{color:#6dff00;}
.false{color:#ff0000;}
.big_board{background-color:#009BCE;color:#FFF;}
.board_title{margin-bottom:1px;border:1px solid #09F;}
</style>
</head>
<body>
<div class="big_board"><div class="board_title">爱特文管－路径信息</div></div>
HTML;
echo '<a href="index.php?path='.$_GET['path'].'">'.realpath(_decode($_GET['path'])).'</a>';
if(count($_SESSION['path'])<=0) {
echo <<<HTML
<div class="big_board"><div class="board_tard_title">爱特文管－系统警告</div></div>
Hello,待处理文件为空!
HTML;
} else {
echo <<<HTML
<div class="big_board"><div class="board_title">删除文件－删除结果</div></div>
HTML;
echo <<<HTML
<span class="true">[O]</span>删除成功 <span class="false">[X]</span>删除异常
HTML;
foreach($_SESSION['path'] as $ipath) {
echo <<<HTML
<div class="big_board"><div class="board_title"></div></div>
HTML;
if($_GET['svn']){
$pth=escapeshellarg(svnpath(_decode($ipath)));
$cmd="svn del $pth $_SESSION[key]";
if($_GET['svn']==2) $cmd.=" --force";
echo htmlcode(cmd($cmd));
}else{
if(is_dir($ipath=_decode($ipath))) {
removeDir($ipath);
if(is_dir($ipath)==false) {
echo '[O]<span class="true">'.basename($ipath).'/</span>';
} else {
echo '[X]<span class="false">'.basename($ipath).'/</span>';
}
}
if(is_file($ipath)) {
if(removeFile($ipath)) {
echo '[O]<span class="true">'.basename($ipath).'</span>';
} else {
echo '[X]<span class="false">'.basename($ipath).'</span>';
}
}
}
/*foreach end*/
}
}
echo <<<HTML
<div class="big_board"><div class="board_title">By：Admin@Lspecial.Com</div></div>
</body>
</html>
HTML;
unset($_SESSION['path']);
?>